package com.jxjk.reportwork.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.jxjk.reportwork.exceldo.BusinessTripInExcelDO;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;

import java.util.List;

/**
 * 2024.9.13: 解析差旅明细excel表格
 */
@Slf4j
@Data
public class BusinessTripListener extends AnalysisEventListener<BusinessTripInExcelDO> {
    private List<BusinessTripInExcelDO> businessTripList = Lists.newArrayList();

    @Override
    public void invoke(BusinessTripInExcelDO businessTrip, AnalysisContext analysisContext) {
        this.businessTripList.add(businessTrip);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("解析差旅单完毕");
    }
}
